/*
 * Copyright (C) 2020 The LINN Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package com.juqimiao.linn.command;

import com.juqimiao.linn.transfer.Command;
import com.juqimiao.linn.transfer.Response;

/**
 * 表示一个命令执行器的接口，实现这个接口的具体命令执行器类会处理一类命令
 * 继承于{@link com.juqimiao.linn.transfer.Command}的命令。
 *
 *
 * @param <R> {@link Response} 或 实现了{@link Response}的实现类的对象。
 * @param <C> {@link Command} 或 实现了{@link Command}的实现类的对象。
 *
 * @author  Collin Cai 2020/2/3
 */
public interface CommandExecutorI<R extends Response, C extends Command> {
    /**
     * 执行一个命令。
     *
     * @param cmd 具体的命令对象。
     * @return 响应对象。
     */
    R execute(C cmd);
}
